package daiwei.javaWeb.exam.meta;

public class Result {
	private int code ;
	private String message;
	private Boolean result;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Boolean getResult() {
		return result;
	}
	public void setResult(Boolean result) {
		this.result = result;
	}
	
	public void isSell(boolean theResult) {
		if(!theResult) {
			code = 200;
			message="";
			result=true;
		} else {
			code = 400;
			message="buyFailed";
			result=false;
		}
	}
	
	public void islogin(boolean TheResult) {
		if(TheResult) {
			code = 200;
			message="";
			result = true;
		} else {
			code = 400;
			message = "LoginFailed";
			result = false;
		}
	}
	
	public void isdelete(boolean TheResult) {
		if(TheResult) {
			code = 200;
			message="";
			result = true;
		} else {
			code = 400;
			message = "deleteFailed";
			result = false;
		}
	}
}
